package leetcode;

import com.alibaba.fastjson.JSON;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Description：
 * @Author：LiDong
 * @Create：2021/3/10
 * @Version：1.0.0
 */
public class Test1480 {

    private static final Logger logger = LoggerFactory.getLogger(Test1480.class);


    public int[] runningSum(int[] nums) {
        int[] arr = new int[nums.length];
        for(int i=0;i<nums.length;i++){
            int sum = 0;
            for(int j=0;j<=i;j++){
                sum+=nums[j];
            }
            arr[i]=sum;
        }
        return arr;
    }

    @Test
    public void test1(){
        int[] arr = {1,2,4,5,7};
        int[] ints = runningSum(arr);
        logger.info(JSON.toJSONString(ints));
    }
}
